package com.windfone.web.action;

import java.io.FileOutputStream;

import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class PortraitUploadAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}
	public String   portraitUpload() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse reponse= ServletActionContext.getResponse();
//		ServletOutputStream out = reponse.getOutputStream();
		ServletInputStream input = request.getInputStream();
		FileOutputStream output = new FileOutputStream("c:/tmp.txt");
		int data = -1;
		data = input.read();
		while( data !=-1){
			output.write(data);
			data = input.read();
		}
		output.close();
		return SUCCESS;
	}
	public String   memberInfo() throws Exception {
		return SUCCESS;
	}

}
